<template>
  <div class="scoreAll">
    <div class="basicInfo">
      <span>赛事名称：<b>xxx夏季网球大赛</b></span>
      <span>裁判长：<b>刘德华</b></span>
    </div>
    <div class="tableBox">
      <draggable v-model="list" class="panel__body--list" :options="{group:'people'}">
      <div v-for="element in list" class="panel__body--item">{{element.label}}</div>
      </draggable>
      <div class="date">
               <span>
                   比赛日期：
               </span>
        <el-date-picker v-model="date" type="date" placeholder="选择日期">
        </el-date-picker>
      </div>
      <table>
        <thead>
        <tr>
          <td>场序</td>
          <td>1号场地</td>
          <td>2号场地</td>
        </tr>
        </thead>
        <tbody>
        <tr>
          <td>1</td>
          <td>
            <draggable v-model="list2" class="panel__body--list" :options="{group:'people'}">
            <div v-for="element in list2" class="panel__body--item">{{element.label}}</div>
            </draggable>
          </td>
          <td>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>

<script>
  import draggable from 'vuedraggable'
  export default {
    name: "scheduleAuto",
    components:{
      draggable,
    },
    watch:{
      list2(val){
        console.log(val)
        console.log(val.length)
      },
    },
    data(){
      return{
        list:[
          {
            id: 1,
            label: 'a'
          },
          {
            id: 2,
            label: 'b'
          },
          {
            id: 3,
            label: 'c'
          },
          {
            id: 4,
            label: 'd'
          },
          {
            id: 5,
            label: 'e'
          },
          {
            id: 6,
            label: 'f'
          },
        ],
        list2:[],
        date:''
      }
    }
  }
</script>

<style lang="less" scoped>
.dragArea{
  width: 200px;
  height: 100px;
  background: #ffff;
}
.normal {
  background-color: grey;
}
.scoreAll{
  padding:20px;
.basicInfo{
  background: rgba(66,185,131,.1);
  border-radius: 2px;
  line-height: 40px;
  height: 40px;
  padding: 15px;
  overflow: hidden;
span{
  margin-right:20px;
}
.btnGroup{
  height: 60px;
  float: right;
  margin-right:20px;
}
}
.tableBox{
  box-shadow: 0px 2px 5px #eaeaea;
  margin-top:20px;
  border:1px solid #eaeaea;
  padding:10px;
.panel__body--list{
  width: 100%;
  height: 50px;
.panel__body--item{
  height: 40px;
  width: 120px;
  border:1px solid #eaeaea;
  box-shadow: 0px 3px 4px #eaeaea;
  float: left;
  line-height: 40px;
  text-align: center;
}
}
.date{
  padding-left:10px;
}
table{
  margin-top:10px;
  width: 100%;
  text-align: center;
  border-collapse:collapse;
  border-left:1px solid #eaeaea;
  border-top:1px solid #eaeaea;
thead{
tr{
  height: 40px;
  background-color: rgba(66, 185, 131, 0.1);
td{
  border-right:1px solid #eaeaea;
  border-bottom:1px solid #eaeaea;
}
}
}
tbody{
tr{
  width: 100%;
  height: 120px;
td{
  width: 120px;
  border-right:1px solid #eaeaea;
  border-bottom:1px solid #eaeaea;
input{
  text-align: center;
  width: 100px;
  border:0;
  height: 30px;
  line-height: 30px;
}
}
}
}
}
}
}
</style>
